; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s

define i16 @test(ptr %tmp179) nounwind  {
; CHECK-LABEL: test:
; CHECK:       ## %bb.0:
; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT:    movzwl (%eax), %eax
; CHECK-NEXT:    movl %eax, %ecx
; CHECK-NEXT:    andl $64512, %ecx ## imm = 0xFC00
; CHECK-NEXT:    cmpl $32768, %ecx ## imm = 0x8000
; CHECK-NEXT:    jne LBB0_2
; CHECK-NEXT:  ## %bb.1: ## %bb189
; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
; CHECK-NEXT:    retl
; CHECK-NEXT:  LBB0_2: ## %bb288
; CHECK-NEXT:    movw $32, %ax
; CHECK-NEXT:    retl
	%tmp180 = load i16, ptr %tmp179, align 2		; <i16> [#uses=2]
	%tmp184 = and i16 %tmp180, -1024		; <i16> [#uses=1]
	%tmp186 = icmp eq i16 %tmp184, -32768		; <i1> [#uses=1]
	br i1 %tmp186, label %bb189, label %bb288

bb189:		; preds = %0
	ret i16 %tmp180

bb288:		; preds = %0
	ret i16 32
}
